<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../../common/meta.jsp"%>
		<script type="text/javascript"
			src="${path}/script/lhgdialog/lhgdialog.min.js">
</script>
		<script type="text/javascript">

$(function() {
	$("#fullScreen").click(function() {
		fullScreen.FullScreen("mytable");
	});
})

$(document).ready(function() {
	if ("${msg}")
		alert("${msg}");
	
	//是否显示
	var validFlag="${validFlag}"
	$("#validFlag").children("option").each(function(){
		if($(this).attr("value")==validFlag)
		$(this).attr("selected","selected");
	});
});

function openCut(url) {
	$.dialog( {
		title : '头像修改',
		lock : true,
		background : '#FFF',
		opacity : 0.1,
		max : true,
		min : true,
		width : '700px',
		height : '450px',
		content : 'url:' + url
	});
}

function deletePic(id) {

	//alert(saleNewsId);
	var url = "${path}/manage/agenter/index/delete?agentId=" + id;
	art.dialog( {
		lock : true,
		content : '确定要删除吗？',
		ok : function() {
			art.dialog( {
				id : "loading",
				lock : true,
				drag : false,
				resize : false,
				title : "正在进行...",
				time : 5
			});
			$.post(url, null, function(result) {
				art.dialog( {
					id : 'loading'
				}).close();//关闭等待框
					if (result.flag) {
						art.dialog( {
							icon : "succeed",
							content : "删除成功!",
							lock : true,
							ok : function() {
								$("#photo").attr("src",
										"${path}" + result.photo);

								location.reload();
							}
						});
					} else {
						art.dialog( {
							icon : "error",
							content : "删除失败!",
							lock : true,
							ok : true
						});
					}

				});

			return true;
		},
		cancelVal : '取消',
		cancel : true
	});
}
</script>

	</head>

	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>
		<!--右边-->
		<div class="webpart3 contentarea">
			<div class="webpart-head">
				<div class="webpart-head-item">
					榜单维护
					<div class="tools-btn">
						<a href="####" id="fullScreen"><span> <img
									src="${path}/statics/images/qp.gif"
									style="margin-right: 4px; margin-bottom: -3px;" />全屏</span> </a>
					</div>
				</div>
			</div>
			<div class="webpart-main">
				<div class="webpart-main-item" style="padding-top: 12px;">
					<div class="search">
						<!----------- 查询信息 ------------------>
						<form method="get">
							<table cellpadding="0" cellspacing="0">
								<tr>
									<th width="">
										姓名：
									</th>
									<td>
										<input type="text" name="agentName" id="agentName"
											class="input-txt" value="${agentName}"  >
									</td>
									<th>
										销售代码:
									</th>
									<td>
										<input type="text" name="agentCode" id="agentCode"
											class="input-txt" value="${agentCode}"  >
									</td>
									<th>
										机构:
									</th>
									<td>
										<%-- <input type="text" name="agentBranch" id="agentBranch"
											class="input-txt" value="${agentBranch}"  >
											 --%>
											<select class="input-txt" name="branchid"
												id="branchid">
												<c:forEach items="${BranchList}" var="branch">
													<option value="${branch.branchId }"
													<c:if test="${branchid==branch.branchId }"> selected='selected'</c:if>>
														${branch.branchName}
													</option>
												</c:forEach>
											</select>
									</td>

									<th >
										<input type="submit" class="linkbtn2" value="查询" />
										
									</th>
								</tr>
								
								<tr>
									<th>
                                        开始日期：
                                    </th>
                                    <td>
                                        <input id="beginCreateDate" name="beginCreateDate" type="text"
										onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate input-txt" readOnly="true"
										value="${beginCreateDate}"/>
                                    </td>
                                    <th>
                                        结束日期:
                                    </th>
                                    <td>
                                        <input id="endCreateDate" name="endCreateDate" type="text"  
										onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate input-txt" readOnly="true"
										value="${endCreateDate}"/>
                                    </td>
									<th>
										是否显示:
									</th>
									<td>
								 		<select id="validFlag" type="text" name="validFlag" class="input-txt" style="width: 115px;">
								 					<option value="">全部</option> 
								 					 <option value="1">是</option> 
								 					 <option value="0">否</option>
								 				</select>
									</td>
									<th >
										 
										<input type="button" class="linkbtn2" value="清空"
											onclick="location.href='${path}/manage/agenter/index/getusers';" />
									</th>
								</tr>

							</table>
						</form>
					</div>
					<!----------- 数据列表 ------------------>
					<table cellpadding="0" cellspacing="0"
						class="dg_borderstyle trStyleTable"
						style="margin-top: 15px; line-height: 23px;" id="mytable">
						<tr>
								<th >
								序号
							</th>
							<th>
								代理人姓名
							</th>
							
							<th>
								代理人机构
							</th>
							
							<th>
								代理人代码
							</th>
							
							<th>
								荣誉日期
							</th>
							
							<th>
								有效期
							</th>
							
							<th>
								是否荣誉显示
							</th>
							
							<th>
								晋升描述
							</th>

							<th>
								操作
							</th>
						</tr>
						<c:forEach items="${pagination.resultList}" var="user"  varStatus="ind">
							<tr>
							  <td align="center">${(pagination.page-1)*10+(ind.index+1)}</td> 
							
								<td align="center">
									${user.agentName}
								</td>

								<td>
									${user.branchname}
								</td>
								
								<td>
									${user.agentcode}

								</td>
								
								<td>
									<fmt:formatDate
										value="${user.changedate}" pattern="yyyy-MM-dd" />
								</td>
								
								<td>
								${user.honourVaildDate}
									
								</td>
								
								<td>
									${empty(user.validFlag) ?'否':user.validFlag=='0'?'否':'是'}
								</td>
								
								<td >
								    <span style="width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;" title="${user.remark}">${user.remark}</span>
								</td>


								<td align="center">
									
									<c:if test="${empty(user.vcol1)}">	
									 <a href="${path}/manage/agenter/index/newagentinfo?agentId=${user.agentId}&agentLogId=${user.agentlogid}&changeDate=${user.changedate}">新增信息</a>
									</c:if>
									
									<c:if test="${not empty(user.vcol1)}">	
									 <a href="${path}/manage/agenter/index/editagentinfo?agentId=${user.agentId}&agentLogId=${user.agentlogid}">修改信息</a>
									</c:if>

								</td>

							</tr>
						</c:forEach>
					</table>





					<!----------- 翻页导航 ------------------>
					<div class="dg_pagerstyle">
						<div class="pageinfo">
							第${pagination.page }页 | 共${pagination.totalPages
							}页/${pagination.totalRows }条记录
						</div>
						<div class="pagebtn">
							${pagination.multiPage}&nbsp;
						</div>
					</div>

				</div>
			</div>
			<div class="webpart-foot">
				<div class="webpart-foot-item">
				</div>
			</div>
		</div>

		<sfa:mainFooter></sfa:mainFooter>

	</body>
</html>


